<!DOCTYPE html>
<!-- html -->
<html>
<!-- head -->

<head>
    <title>恋爱攻略</title>
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
    <!-- bootstrap-CSS -->
    <link href="css/font-awesome.css" rel="stylesheet" type="text/css" media="all" />
    <!-- Fontawesome-CSS -->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script type='text/javascript' src='js/jquery-2.2.3.min.js'></script>
    <script type='text/javascript' src='js/template.js'></script>
    <!-- Custom Theme files -->
    <link href="css/menu.css" rel="stylesheet" type="text/css" media="all" />
    <!-- menu style -->
    <!--theme-style-->
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
    <!--//theme-style-->
    <link rel="stylesheet" type="text/css" href="css/easy-responsive-tabs.css " />
    <!--meta data-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="keywords" content="" />
    <script type="text/javascript">
    function isWeixnOpen() {

        var ua = navigator.userAgent.toLowerCase();

        if (ua.match(/MicroMessenger/i) == "micromessenger") {

            return true;

        } else {

            return false;

        }

    }
    $(function() {
        if (isWeixnOpen()) {

        } else {
            // document.oncontextmenu=new Function("event.returnValue=false;");
            // document.onselectstart=new Function("event.returnValue=false;");
            // $("body").text("请在微信打开");
            // $("body").css("text-align","center");
        }
    })
    </script>
    <script type="application/x-javascript">
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);

    function hideURLbar() { window.scrollTo(0, 1); }
    </script>
    <!--//meta data-->
    <!-- nav smooth scroll -->
    <script>
    $(document).ready(function() {
        $(".dropdown").hover(
            function() {
                $('.dropdown-menu', this).stop(true, true).slideDown("fast");
                $(this).toggleClass('open');
            },
            function() {
                $('.dropdown-menu', this).stop(true, true).slideUp("fast");
                $(this).toggleClass('open');
            }
        );
    });
    </script>
    <!-- //nav smooth scroll -->
    <style type="text/css">
    .tabStyle {
        width: 100%;
        height: 50px;
    }

    .tabStyle_style {
        float: left;
        width: 33%;
        line-height: 40px;
        text-align: center;
        list-style: none;
        border-bottom: 2px solid #ddd;
    }

    .select_style {
        color: #00c4da;
        border-bottom: 2px solid #00c4da;
    }
    </style>
</head>
<!-- //head -->
<!-- body -->

<body>
    <!-- header -->
    <!-- <header>
    <div class="navbar navbar-inverse-blue navbar">
        <div class="navbar-inner">
            <div class="container">
                <div class="menu">
                    <div>
                        <a class="cd-dropdown-trigger" href="#0" style="color: rgba(0,0,0,0);">浏览资料</a>
                    </div>
                </div>
                <div class="pull-right">
                    <nav class="navbar nav_bottom" role="navigation">
                        <div class="navbar-header nav_2">
                            <button type="button" class="navbar-toggle collapsed navbar-toggle1" data-toggle="collapse" data-target="#bs-megadropdown-tabs">菜单
                                <span class="sr-only">切换导航</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                        </div>
                        <div class="collapse navbar-collapse" id="bs-megadropdown-tabs">
                            <ul class="nav navbar-nav nav_1">
                                <li class="active"><a href="index.html">首页</a></li>
                                <li><a href="./activity.html">活动</a></li>
                                <li><a href="./emotional.html">情感专栏</a></li>
                                <li class="last"><a href="./loveLesson.html">恋爱技巧</a></li>
                            </ul>
                        </div>
                    </nav>
                </div>
                <div class="clearfix"> </div>
            </div>
        </div>
    </div>
</header> -->
    <!-- /header -->
    <!-- inner banner -->
    <!-- //inner banner -->
    <div style="position: relative;">
        <img style="width: 100%;" src="./images/lianai.png">
        <img style="position: absolute;width: 30%;top: 10px;left: 10px;" src="./images/logo.png">
    </div>
    <!-- <div class="w3layouts-inner-banner">
        <div class="container">
            <div class="logo">
                <h1><a class="cd-logo link link--takiri" href="index.html">朝阳E恋 <span><i class="fa fa-heart" aria-hidden="true"></i></span></a></h1>
            </div>
            <div class="clearfix"></div>
        </div>
    </div> -->
    <!-- breadcrumbs -->
    <!-- //breadcrumbs -->
    <!-- Bridegroom Profile Details -->
    <div class="w3ls-list">
        <div class="container">
            <ul class="tabStyle">
                <li class="tabStyle_style select_style" value="0">热门文章</li>
                <li class="tabStyle_style " value="1">点赞最多</li>
                <li class="tabStyle_style " value="2">最新发布</li>
            </ul>
            <div class="col-md-3 w3ls-aside">
                <div class="view_profile" id="showList">
                    <script id="tpl" type="text/html">
                        <%:=newsListTpl({list: list1, newsTpl: newsTpl})%>
                    </script>
                    <script id="child-tpl" type="text/html">
                        <%list.forEach(function (news) {%>
                            <%:=newsTpl(news)%>
                                <%})%>
                    </script>
                    <script id="sub-child-tpl" type="text/html">
                        <ul class="profile_item">
                            <a href="./nhtml/loveDetail0.html?id=<%=ARTICLE_ID%>">
                                <li class="profile_item-img">
                                    <img src="<%=HOMEPAGE_IMAGE%>" class="img-responsive" alt="">
                                </li>
                                <li class="profile_item-desc">
                                    <h6><%=TITLE%></h6>
                                    <p></p>
                                    <p style="color:#d1d1d1">
                                        <%=summary%>
                                    </p>
                                </li>
                                <div class="clearfix"> </div>
                            </a>
                        </ul>
                    </script>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
    <script src="js/easyResponsiveTabs.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {

        $('#parentHorizontalTab').easyResponsiveTabs({
            type: 'default', //Types: default, vertical, accordion
            width: 'auto', //auto or any width like 600px
            fit: true, // 100% fit in a container
            closed: 'accordion', // Start closed if in accordion view
            tabidentify: 'hor_1', // The tab groups identifier
            activate: function(event) { // Callback function if tab is switched
                var $tab = $(this);
                var $info = $('#nested-tabInfo');
                var $name = $('span', $info);

                $name.text($tab.text());

                $info.show();
            }
        });

    });
    </script>
    <!-- //Bridegroom Profile Details -->
    <!-- browse profiles -->
    <!-- //browse profiles -->
    <!-- Get started -->
    <!-- //Get started -->
    <!-- footer -->
    <!-- <footer>
    <div class="footer">
        <div class="container">
            <div class="footer-info w3-agileits-info">
                <div class="col-md-4 address-left agileinfo">
                    <div class="footer-logo header-logo">
                        <h6>联系我们</h6>
                    </div>
                    <ul>
                        <li><i class="fa fa-map-marker"></i> 北京海淀区中关村</li>
                        <li><i class="fa fa-mobile"></i> 18837525123 </li>
                        <li><i class="fa fa-envelope-o"></i> <a href="mailto:example@mail.com"> 123456@qq.com</a></li>
                    </ul>
                </div>
                <div class="col-md-8 address-right">
                    <div class="col-md-4 footer-grids">
                        <h3>公司</h3>
                        <ul>
                            <li><a href="about.html">关于我们</a></li>
                        </ul>
                    </div>
                    <div class="col-md-4 footer-grids">
                        <h3>快速链接</h3>
                        <ul>
                            <li><a href="privacy_policy.html">隐私策略</a></li>
                        </ul>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="copy-right">
        <div class="container">
        </div>
    </div>
</footer> -->
    <!-- //footer -->
    <!-- menu js aim -->
    <script src="js/jquery.menu-aim.js">
    </script>
    <script src="js/main.js"></script>
    <!-- Resource jQuery -->
    <!-- //menu js aim -->
    <!-- for bootstrap working -->
    <script src="js/bootstrap.js"></script>
    <!-- //for bootstrap working -->
    <script type="text/javascript">
    $(document).ready(function() {
      
        $().UItoTop({ easingType: 'easeOutQuart' });

    });
    </script>
    <a href="#" id="toTop" style="display: block;"> <span id="toTopHover" style="opacity: 1;"> </span></a>
    <!-- for smooth scrolling -->
    <script type="text/javascript" src="js/move-top.js"></script>
    <script type="text/javascript" src="js/easing.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        $(".scroll").click(function(event) {
            event.preventDefault();
            $('html,body').animate({ scrollTop: $(this.hash).offset().top }, 1000);
        });
    });
    </script>
    <script type="text/javascript">
    var tpl = template(document.getElementById('tpl').innerHTML);
    var childTpl = template(document.getElementById('child-tpl').innerHTML);
    var subChildTpl = template(document.getElementById('sub-child-tpl').innerHTML);
    getAllActicle();
    var arr1 = new Array();
    var arr2 = new Array();
    var arr3 = new Array();

    function getAllActicle() {

        $.ajax({
            method: "get",

            url: "/article/getAllArticle",
            success: function(res) {
                console.log(res);
                for (var i = 0; i < res.data.length; i++) {
                    if (res.data[i].art_type == 1) {
                        arr1.push(res.data[i]);
                    } else if (res.data[i].art_type == 2) {
                        arr3.push(res.data[i]);
                    } else if (res.data[i].art_type == 3){
                        arr3.push(res.data[i]);
                    }
                }
                showView(arr1)
                //window.location.href = './index_add.html'
            },
            error: function(error) {
                console.log(error)
            }
        })
    }

    function showView(showArr) {
        if (showArr.length==0) {
            var json={
                TITLE:"暂无数据"
            }
            showArr.push(json)
        }
        var html = tpl({
            newsListTpl: childTpl,
            newsTpl: subChildTpl,
            list1: showArr
        })
       
        document.getElementById('showList').innerHTML = html;
    }
    $(".tabStyle li").click(function() {
        $(this).addClass('select_style')
        $(this).siblings().removeClass('select_style')
        if ($(this).val()=='0') {
           showView(arr1)
        }else if($(this).val()=='1'){
           showView(arr2)
        }else{
          showView(arr3)
        }
    })
    </script>
    <!-- //for smooth scrolling -->
</body>
<!-- //body -->

</html>
<!-- //html -->